<?php defined('SYSPATH') or die('No direct script access.'); ?>
<div class="box">
	<?php 
		// Check if there are any items
		if (count($posts) < 1)
			echo I18n::get('No blog were posts found');
		
		// Or go through all of them
		else 
			foreach ($posts as $post)
			{
	?>
				<div class="box2" id="<?php echo $post->id; ?>">
					<!-- Post -->
					<h2><?php echo HTML::anchor('blog/view/' . $post->id . '/' . URL::title($post->title), $post->title); ?></h2>
					<b><?php echo I18n::get('Posted on') . ': ' . $post->date; ?></b>
					<div class="box3">
						<?php
							echo substr($post->content, 0, $desc_length);
						?>
					</div>
					
					<!-- Box -->
					<div style="margin-top: 8px; float: left;">
						<b><?php echo I18n::get('Posted by') . ': ' . $post->user; ?></b>
					</div>
					
					<!-- Actions -->
					<div style="margin-top: 8px; float: right;">
						<?php echo View::factory('blog/index/actions')->bind('post', $post); ?>
					</div>
					
					<br style="font-size: 26px; "/>
				</div>
	<?php
			}
	?>
</div>